home *** CD-ROM | disk | FTP | other *** search
/ Diccionario Visual Trilingue / VISUAL.iso / SHARED.DIR / 10114_Position de illustrations.ls < prev    next >
Encoding:
Text File  |  1997-07-04  |  1.3 KB  |  39 lines

  1. on mouseDown
  2.   global gCurrentPos, gNbItem
  3.   set Delta to the mouseV - the locV of sprite 27
  4.   set TempV to the mouseV - Delta
  5.   set TempV2 to the mouseV
  6.   set CurrentP to getAt(gCurrentPos, 3)
  7.   repeat while the mouseDown
  8.     if rollOver(26) and (TempV2 <> the mouseV) then
  9.       set TempV to the mouseV - Delta
  10.       set TempV2 to the mouseV
  11.       if TempV > (SpriteBottom(26) - (SpriteHeight(27) / 2)) then
  12.         set the locV of sprite 27 to SpriteBottom(26) - (SpriteHeight(27) / 2)
  13.       else
  14.         if TempV < (SpriteTop(26) + (SpriteHeight(27) / 2)) then
  15.           set the locV of sprite 27 to SpriteTop(26) + (SpriteHeight(27) / 2)
  16.         else
  17.           set the locV of sprite 27 to TempV
  18.         end if
  19.       end if
  20.       updateStage()
  21.       set Percent to (the locV of sprite 27 - SpriteTop(26) - (SpriteHeight(27) / 2)) / ((SpriteHeight(26) - SpriteHeight(27)) * 1.0)
  22.       if Percent >= 1 then
  23.         setAt(gCurrentPos, 3, getAt(gNbItem, 3) - 5)
  24.       else
  25.         if Percent = 0 then
  26.           setAt(gCurrentPos, 3, 1)
  27.         else
  28.           setAt(gCurrentPos, 3, integer(Percent * (getAt(gNbItem, 3) - 6)) + 1)
  29.         end if
  30.       end if
  31.       if getAt(gCurrentPos, 3) <> CurrentP then
  32.         set CurrentP to getAt(gCurrentPos, 3)
  33.         SetWindow2(3, 14)
  34.       end if
  35.     end if
  36.   end repeat
  37.   ActiveField(3)
  38. end
  39.